/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [ExaminationFactory.java]
 * Creation Date        [12-Jul-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_04_other.examApp.dao;

import pkg_04_other.examApp.dao.impl.PaperLogicImpl;
import pkg_04_other.examApp.dao.impl.ScoreLogicImpl;
import pkg_04_other.examApp.dao.impl.StudentLogicImpl;

/**
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class ExaminationFactory {

	/**
	 * 获得具体的考试逻辑实例
	 * 
	 * @param logicName
	 * @return
	 */
	public static ExaminationAdapter getExaminationInstance(String logicName) {
		if ("student".equalsIgnoreCase(logicName)) {
			return new StudentLogicImpl();
		}
		if ("paper".equalsIgnoreCase(logicName)) {
			return new PaperLogicImpl();
		}
		if ("score".equalsIgnoreCase(logicName)) {
			return new ScoreLogicImpl();
		}
		return new ExaminationAdapter();
	}

}
